﻿using Springwater.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Springwater.Business.ViewModels
{
    public class ManagePictureModel
    {
        public int BorvizId { get; set; }
        public List<PictureModel> PictureList { get; set; }

        public ManagePictureModel(Borviz borviz)
        {
            this.BorvizId = borviz.Id;
            this.PictureList = new List<PictureModel>();

            if (borviz.Fenykepek != null)
            {
                foreach (var fenykep in borviz.Fenykepek)
                {
                    this.PictureList.Add(new PictureModel(fenykep.Id, fenykep.Datum, fenykep.Szerzo, fenykep.File, fenykep.Elsodleges));
                }
            }
        }
    }

    public class PictureModel
    {
        public int Id { get; set; }
        public DateTime Datum { get; set; }
        public string Szerzo { get; set; }
        public string File { get; set; }
        public bool Elsodleges { get; set; }

        public PictureModel(int id, DateTime datum, string szerzo, string file, bool elsodleges)
        {
            this.Id = id;
            this.Datum = datum;
            this.Szerzo = szerzo;
            this.File = file;
            this.Elsodleges = elsodleges;
        }
    }
}
